import request from '@/utils/request'

export function addLease(leaseData) {
  return request({
    url: '/lease/add',
    method: 'post',
    data: leaseData
  })
}

export function getPage(name, page, pageSize) {
  return request({
    url: '/lease/page',
    params: {
      name: name,
      page: page,
      pageSize: pageSize
    },
    method: 'get'
  })
}
export function getCategory(){
  return request({
    url: '/category',
    method: 'get'
  })
}
export function getLease(id) {
  return request({
    url: '/lease/' + id,
    method: 'get'
  })
}
export function modifyLease(leaseData) {
  return request({
    url: '/lease/modify',
    method: 'post',
    data: leaseData
  })
}

export function del(ids) {
  return request({
    url: '/lease?ids=' + ids,
    method: 'delete'
  })
}

export function changeStatus(status, id) {
  return request({
    url: '/lease/status/' + status,
    method: 'post',
    params: {
      id: id
    }
  })
}


export function getRollImage(){
  return request({
    url: '/lease/rollImage',
    method: 'get',
  })
}

export function rollImageSubmit(rollImageData){
  return request({
    url: '/lease/rollImage' ,
    method: 'post',
    data: rollImageData
  })
}